# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ImportRagFilesConfig do
  @moduledoc """
  Config for importing RagFiles.

  ## Attributes

  *   `gcsSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsSource.t`, *default:* `nil`) - Google Cloud Storage location. Supports importing individual files as well as entire Google Cloud Storage directories. Sample formats: - `gs://bucket_name/my_directory/object_name/my_file.txt` - `gs://bucket_name/my_directory`
  *   `googleDriveSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GoogleDriveSource.t`, *default:* `nil`) - Google Drive location. Supports importing individual files as well as Google Drive folders.
  *   `importResultBigquerySink` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t`, *default:* `nil`) - The BigQuery destination to write import result to. It should be a bigquery table resource name (e.g. "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the table does not exist, it will be created with the expected schema. If the table exists, the schema will be validated and data will be added to this existing table.
  *   `importResultGcsSink` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t`, *default:* `nil`) - The Cloud Storage path to write import result to.
  *   `jiraSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1JiraSource.t`, *default:* `nil`) - Jira queries with their corresponding authentication.
  *   `maxEmbeddingRequestsPerMin` (*type:* `integer()`, *default:* `nil`) - Optional. The max number of queries per minute that this job is allowed to make to the embedding model specified on the corpus. This value is specific to this job and not shared across other import jobs. Consult the Quotas page on the project to set an appropriate value here. If unspecified, a default value of 1,000 QPM would be used.
  *   `partialFailureBigquerySink` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t`, *default:* `nil`) - The BigQuery destination to write partial failures to. It should be a bigquery table resource name (e.g. "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the table does not exist, it will be created with the expected schema. If the table exists, the schema will be validated and data will be added to this existing table. Deprecated. Prefer to use `import_result_bq_sink`.
  *   `partialFailureGcsSink` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t`, *default:* `nil`) - The Cloud Storage path to write partial failures to. Deprecated. Prefer to use `import_result_gcs_sink`.
  *   `ragFileParsingConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileParsingConfig.t`, *default:* `nil`) - Optional. Specifies the parsing config for RagFiles. RAG will use the default parser if this field is not set.
  *   `ragFileTransformationConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileTransformationConfig.t`, *default:* `nil`) - Specifies the transformation config for RagFiles.
  *   `sharePointSources` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SharePointSources.t`, *default:* `nil`) - SharePoint sources.
  *   `slackSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SlackSource.t`, *default:* `nil`) - Slack channels with their corresponding access tokens.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :gcsSource => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsSource.t() | nil,
          :googleDriveSource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GoogleDriveSource.t() | nil,
          :importResultBigquerySink =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t() | nil,
          :importResultGcsSink =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t() | nil,
          :jiraSource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1JiraSource.t() | nil,
          :maxEmbeddingRequestsPerMin => integer() | nil,
          :partialFailureBigquerySink =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t() | nil,
          :partialFailureGcsSink =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t() | nil,
          :ragFileParsingConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileParsingConfig.t() | nil,
          :ragFileTransformationConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileTransformationConfig.t()
            | nil,
          :sharePointSources =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SharePointSources.t() | nil,
          :slackSource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SlackSource.t() | nil
        }

  field(:gcsSource, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsSource)

  field(:googleDriveSource,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GoogleDriveSource
  )

  field(:importResultBigquerySink,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination
  )

  field(:importResultGcsSink,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination
  )

  field(:jiraSource, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1JiraSource)
  field(:maxEmbeddingRequestsPerMin)

  field(:partialFailureBigquerySink,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination
  )

  field(:partialFailureGcsSink,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination
  )

  field(:ragFileParsingConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileParsingConfig
  )

  field(:ragFileTransformationConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RagFileTransformationConfig
  )

  field(:sharePointSources,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SharePointSources
  )

  field(:slackSource, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SlackSource)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ImportRagFilesConfig do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ImportRagFilesConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ImportRagFilesConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
